/*
 * usart.c
 *
 *  Created on: 02.04.2014
 *      Author: alexs
 */
#include "usart.h"

#define USART_BUFF_SIZE 100
static char buff[USART_BUFF_SIZE];

void put_str(char * c) {
	while (*c) {
		while (!(UCSR0A&(1<<UDRE0))) {}
		UDR0=*(c++);
	}
}

void prn_int(uint16_t i) {
	utoa(i,buff,10);
	put_str(buff);
}
void prn_hex(uint16_t i) {
//	buff[0]='0';
//	buff[1]='x';
	if (i<0x10) {buff[0]='0';utoa(i,&buff[1],16);}
	else utoa(i,&buff[0],16);

	put_str(buff);
}
